home *** CD-ROM | disk | FTP | other *** search
-
- /*© Copyright 1988-1992 UserLand Software, Inc. All Rights Reserved.*/
-
-
- #include <Processes.h>
- #include "appletdialogs.h"
- #include "appletstrings.h"
- #include "appletops.h"
-
-
- #ifdef MPWC
-
- #include <osevents.h>
-
- #endif
-
-
-
-
-
-
- void initmacintosh () {
-
- /*
- the magic stuff that every Macintosh application needs to do
- before doing anything else.
- */
-
- register short i;
-
- MaxApplZone ();
-
- for (i = 1; i < 11; i++)
- MoreMasters ();
-
- InitGraf (&quickdrawglobal (thePort));
-
- InitFonts ();
-
- FlushEvents (everyEvent, 0);
-
- InitWindows ();
-
- InitMenus ();
-
- TEInit ();
-
- InitDialogs (nil);
-
- InitCursor ();
-
- for (i = 1; i <= 5; i++) { /*register with Multifinder*/
-
- EventRecord ev;
-
- EventAvail (everyEvent, &ev); /*see TN180 -- splash screen*/
- } /*for*/
- } /*initmacintosh*/
-
-
- short minint (x, y) short x, y; {
-
- if (x < y)
- return (x);
- else
- return (y);
- } /*minint*/
-
-
- boolean cometofront () {
-
- register short i;
- ProcessSerialNumber psn;
- EventRecord ev;
-
- GetCurrentProcess (&psn);
-
- SetFrontProcess (&psn);
-
- for (i = 1; i <= 3; i++)
- WaitNextEvent (nullEvent, &ev, 1, nil);
- } /*cometofront*/
-
-
- void delayticks (short ct) {
-
- long tc;
-
- tc = TickCount () + ct;
-
- while (TickCount () < tc) {}
- } /*delayticks*/
-
-
- void delayseconds (ct) short ct; {
-
- delayticks (60 * ct);
- } /*delayseconds*/
-
-
- void timestamp (stamp) long *stamp; {
-
- GetDateTime ((unsigned long *) stamp);
- } /*timestamp*/
-
-
- boolean getstringlist (short listnum, short id, bigstring bs) {
-
- /*
- the Mac routine GetIndString doesn't set ResError false when we fall off
- the end of the indicated list, so we return false if the returned string
- is of zero length.
- */
-
- GetIndString (bs, listnum, id);
-
- return (stringlength (bs) > 0);
- } /*getstringlist*/
-
-
-
-
-